<%@page import="java.util.*"%>
<%@page import="lab.domain.SoundRecordingStudio"%>
<%@page extends="lab.jsp.Studios" errorPage="error_page.jsp"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%

    Collection<SoundRecordingStudio> studios = getData();

%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h2>Studios</h2>
        <table>
            <tr><td>№</td><td>Name</td></tr>
            <%
            
                Iterator<SoundRecordingStudio> iter = studios.iterator();
                int number = 1;
                while (iter.hasNext()) {
                    SoundRecordingStudio studio = iter.next();
            %>
            <tr><td><%=number%>.</td><td><a href="edit_studio.jsp?id=<%=studio.getId()%>"><%=studio.getName()%></a></td></tr>
            <%
                number++; }
            %>
        </table>
        <% if (studios.isEmpty()) { %>
        <p><b>No studios found.</b>
        <% } %>
        <br><a href="edit_studio.jsp">New studio</a>
    </body>
</html>
